charset="UTF-8";
$(function() {
    query();
    $("#exm").addClass("m_active");
    $(".foot").addClass("bg_grey");
    $(".close").click(function() {
        $("#dialog").hide();
        $("#del_con").hide();
        $(".page_disabled").hide();
    });
})

function differList(x) {
    $("#examt tr:gt(0)").remove();
    if (x.length > 0) {
        $.each(x, function(index, item) {
            $("#examt").append("<tr class='table_body'><td class='e_no'>" + eval(index+1) +
                    "</td><td class='e_id'>Exam" + item.id +
                    "</td><td class='e_name'><xmp>" + item.examName +
                    "</xmp></td><td class='e_eff'><xmp>" + item.effectiveTime +
                    "</xmp></td><td class='e_dur'><xmp>" + item.duration +
                    "</xmp></td><td class='e_cre'><xmp>" + item.creator +
                    "</xmp></td>" +
            "</tr>");
        })
    } else {
        $("#examt").append("<tr class='table_body'><td align='center' colspan='6'>No Data!</td></tr>");
    }
}
function query() {
    $.ajax({
        type : "get",
        datatype : "json",
        data : $("#pageInfo").serialize(),
        url : "exam/examJson",
        success : function(msg) {
            var jsonObj = eval("(" + msg + ")");
            differList(jsonObj.itemList);
            setInfo(jsonObj.pageSize, jsonObj.fuzzyWord, jsonObj.currentPage, jsonObj.pageCount);
            getPageBar(jsonObj.currentPage, jsonObj.pageCount)
        },
        error : function() {
            alert("Load Failed!")
        }
    });
}
